ALMaSS  1.0
The Animal, Landscape and Man Simulation System
Vole_Base Class Reference

Base class for voles - all vole objects are descended from this class. More...

#include <vole_all.h>

Inheritance diagram for Vole_Base:
TAnimal TALMaSSObject Vole_JuvenileFemale Vole_JuvenileMale Vole_Female Vole_Male

Public Member Functions

 Vole_Base (struct_Vole_Adult *p_aVoleStruct)
 Constructor for Vole_Base. More...
 
virtual ~Vole_Base ()
 
virtual void Init (struct_Vole_Adult *p_aVoleStruct)
 
virtual void ReInit (struct_Vole_Adult *p_aVoleStruct)
 
virtual void BeginStep ()
 BeingStep behaviour - must be implemented in descendent classes. More...
 
virtual void Step ()
 Step behaviour - must be implemented in descendent classes. More...
 
virtual void EndStep ()
 All voles age at the end of the day. More...
 
void st_Dying ()
 All voles end here on death. More...
 
void SetBreedingSeason (bool a_flag)
 Set Breeding Season flag. More...
 
void SetWeight (double W)
 
void Setm_Mature ()
 
void Set_BirthYear (int BirthYear)
 
void Set_MotherId (unsigned MotherIdNo)
 
void Set_FatherId (unsigned FatherIdNo)
 
void Set_NoYoungTot (int a_NoOfYoung)
 
void Set_XBorn (int a_Location_x)
 
void Set_YBorn (int a_Location_y)
 
void Set_ElemBorn (int a_Location_x, int a_Location_y)
 
void Set_VegBorn (int a_Location_x, int a_Location_y)
 
void Set_PolyRefBorn (int a_Location_x, int a_Location_y)
 
void Set_Age (int Age)
 
virtual int WhatState ()
 
bool SupplyBornLastYear ()
 Were we born this year? More...
 
bool SupplyTerritorial ()
 
int SupplyFatherId ()
 
int SupplyMotherId ()
 
bool SupplySex ()
 
int SupplyBirthYear ()
 
int SupplyTotNoYoung ()
 
int SupplyXBorn ()
 
int SupplyYBorn ()
 
int SupplyPolyRefBorn ()
 
int SupplyElemBorn ()
 
TTypesOfLandscapeElement SupplyElemType ()
 
int SupplyVegBorn ()
 
int SupplyTerrRange ()
 
double SupplyWeight ()
 
int SupplyIDNo ()
 
bool SupplyMature ()
 
int SupplyDeathCause ()
 
unsigned SupplyAge ()
 
unsigned SupplyX ()
 
unsigned SupplyY ()
 
bool SupplyInTrap ()
 
InTrapPosition SupplyTrapPosition ()
 
void SetFree ()
 
int SupplyHomoZyg ()
 
int SupplyHeteroZyg ()
 
int SupplyAllele (int locus, int allele)
 
uint32 SupplyMyAllele (int i, int j)
 
int GetGeneticFlag ()
 
int GetDirectFlag ()
 
void SetGeneticFlag ()
 
void SetDirectFlag ()
 
void UnsetGeneticFlag ()
 
void UnsetDirectFlag ()
 
GeneticMaterial SupplyGenes ()
 
virtual void OnKilled ()
 
virtual bool MortalityTest ()
 Do a mortality test. More...
 
void CopyMyself (VoleObject a_vole)
 Duplicates a vole. More...
 
void SetFertile (bool f)
 Set the male vole fertility. More...
 
bool GetFertile ()
 Get the male vole fertility. More...
 
- Public Member Functions inherited from TAnimal
unsigned SupplyFarmOwnerRef ()
 
AnimalPosition SupplyPosition ()
 
APoint SupplyPoint ()
 
int SupplyPolygonRef ()
 
int Supply_m_Location_x ()
 
int Supply_m_Location_y ()
 
virtual void KillThis ()
 
virtual void CopyMyself ()
 
void SetX (int a_x)
 
void SetY (int a_y)
 
 TAnimal (int x, int y, Landscape *L)
 
virtual void ReinitialiseObject (int x, int y, Landscape *L)
 Used to re-use an object - must be implemented in descendent classes. More...
 
virtual void Dying ()
 
void CheckManagement (void)
 
void CheckManagementXY (int x, int y)
 
virtual bool OnFarmEvent (FarmToDo)
 
- Public Member Functions inherited from TALMaSSObject
int GetCurrentStateNo ()
 Returns the current state number. More...
 
void SetCurrentStateNo (int a_num)
 Sets the current state number. More...
 
bool GetStepDone ()
 Returns the step done indicator flag. More...
 
void SetStepDone (bool a_bool)
 Sets the step done indicator flag. More...
 
virtual void ReinitialiseObject ()
 Used to re-use an object - must be implemented in descendent classes. More...
 
 TALMaSSObject ()
 The constructor for TALMaSSObject. More...
 
virtual ~TALMaSSObject ()
 The destructor for TALMaSSObject. More...
 
void OnArrayBoundsError ()
 Used for debugging only, tests basic object properties. More...
 

Public Attributes

TTypeOfVoleState CurrentVState
 
Vole_Population_Managerm_OurPopulation
 

Protected Member Functions

virtual void RodenticideIngestion (void)
 
double CalculateCarryingCapacity (int x, int y, int a_ddep)
 
int MoveQuality (int p_x, int p_y)
 Test a location for quality while moving. More...
 
void MoveTo (int p_Vector, int p_Distance, int iterations)
 Movement. More...
 
void DoWalking (int p_Distance, int &p_Vector, int &vx, int &vy)
 Walking. More...
 
void DoWalkingCorrect (int p_Distance, int &p_Vector, int &vx, int &vy)
 Walking where there is a danger of stepping off the world. More...
 
void Escape (int p_Vector, int p_Distance)
 Dispersal - directed movement. More...
 
void CheckTraps ()
 
virtual void SetLocation ()
 
virtual void FreeLocation ()
 
virtual bool GetLocation (int, int)
 
- Protected Member Functions inherited from TAnimal
void CorrectWrapRound ()
 Corrects wrap around co-ordinate problems. More...
 

Protected Attributes

int m_BirthYear
 
bool m_BornLastYear
 A flag set if the female was born the year before. More...
 
unsigned int m_MinTerrRange
 
unsigned m_MotherId
 
unsigned m_FatherId
 
int m_Death
 
int m_TerrRange
 
bool m_Sex
 
bool m_Mature
 
int m_Age
 
int m_XBorn
 
int m_YBorn
 
int m_PolyRefBorn
 
int m_ElemBorn
 
int m_VegBorn
 
int m_LifeSpan
 
double m_Weight
 
bool m_fertile
 Flag indicating the fertility state (true means fertile)
More...
 
int m_NoOfYoungTotal
 
int m_DispVector
 
bool m_Have_Territory
 
int m_Reserves
 
unsigned IDNo
 
int SimH
 
int SimW
 
GeneticMaterial m_MyGenes
 
InTrapPosition m_intrappos
 
- Protected Attributes inherited from TAnimal
int m_Location_x
 
int m_Location_y
 
Landscapem_OurLandscape
 
- Protected Attributes inherited from TALMaSSObject
int m_CurrentStateNo
 The basic state number for all objects - '-1' indicates death. More...
 
bool m_StepDone
 Indicates whether the iterative step code is done for this timestep. More...
 

Static Protected Attributes

static unsigned int m_MaxMaleTerritorySize = 0
 
static unsigned int m_MaxFemaleTerritorySize = 0
 
static unsigned int m_MinMaleTerritorySize = 0
 
static unsigned int m_MinFemaleTerritorySize = 0
 
static double m_MinFVoleHabQual = 0
 
static double m_MinJMVoleHabQual = 0
 
static double m_MinMVoleHabQual = 0
 
static double m_MaleTerritoryRangeSlope = 0
 
static double m_FemaleTerritoryRangeSlope = 0
 
static double m_FHabQualThreshold3
 
static double m_FHabQualThreshold2
 
static double m_FHabQualThreshold1
 
static double m_MHabQualThreshold3
 
static double m_MHabQualThreshold2
 
static double m_MHabQualThreshold1
 
static bool m_BreedingSeason = false
 

Detailed Description

Base class for voles - all vole objects are descended from this class.

Constructor & Destructor Documentation

◆ Vole_Base()

Vole_Base::Vole_Base ( struct_Vole_Adult p_aVoleStruct)

Constructor for Vole_Base.

228  : TAnimal(p_aVoleStruct->x, p_aVoleStruct->y, p_aVoleStruct->L)
229  {
230  Init(p_aVoleStruct);
231  }
TAnimal(int x, int y, Landscape *L)
Definition: PopulationManager.cpp:1367
virtual void Init(struct_Vole_Adult *p_aVoleStruct)
Definition: Vole_all.cpp:240
int y
Definition: vole_all.h:126
int x
Definition: vole_all.h:125
Landscape * L
Definition: vole_all.h:138

References Init().

◆ ~Vole_Base()

Vole_Base::~Vole_Base ( )
virtual
305 {
306 }

Member Function Documentation

◆ BeginStep()

virtual void Vole_Base::BeginStep ( void  )
inlinevirtual

BeingStep behaviour - must be implemented in descendent classes.

Reimplemented from TAnimal.

Reimplemented in Vole_JuvenileFemale, and Vole_JuvenileMale.

290 {};

◆ CalculateCarryingCapacity()

double Vole_Base::CalculateCarryingCapacity ( int  p_x,
int  p_y,
int  a_ddep 
)
protected

Returns the sum of the qualities in the area covered by the territory (even if the vole does not have one)

Uses the algorithm for fast searching of square arrays with wrap around co-ordinates.
parameters = x,y starting coordinates top left
range = extent of the space to search
bottom left coordinate is therefore x+range, y+range
22/09/2000

For each polygon it gets the quality and multiplies by area of that polygon in the territory. This is summed for all polygons in the territoryto get overall quality. The value is then divided by the number of voles present less a threshold value.

385 {
386  int NoPolygons = 0;
387  int PolyRefData[500][2];
388  // First convert centre co-rdinates to square co-ordinates
389  double quality = 0;
390  int x=p_x - m_MinTerrRange;
391  if (x<0) x+=SimW;
392  int y=p_y - m_MinTerrRange;
393  if (y<0) y+=SimH;
394  int range_x=m_MinTerrRange+m_MinTerrRange;
395  int range_y=m_MinTerrRange+m_MinTerrRange;
396  // Stage 1 make a list of polygons
397  // create the extent variables
398  int xextent0 = x+range_x;
399  int yextent0 = y+range_y;
400  int xextent1 = (x+range_x)-SimW;
401  int yextent1 = (y+range_y)-SimH;
402  // Create the looping variables needed
403  int Dfinx=xextent0;
404  int Dfiny=yextent0;
405  int Afinx=0; // unless the finx values for A-C are changed
406  int Bfinx=0; // the value of zero will stop the A-C loops from executing
407  int Cfinx=0;
408  int Afiny=0; // this one assigned 0 to stop compiler complaints
409  // Now create the loop values;
410  if (x+range_x<=SimW)
411  {
412  // Type B & D (overlap bottom, no overlap)
413  if (yextent0>SimH)
414  {
415  // Type B (overlap bottom only)
416  Dfiny=SimH;
417  Bfinx=x+range_x;
418  }
419  }
420  else
421  {
422  // Type A & C overlap left edge or bottom & left
423  if (yextent0>SimH)
424  {
425  // Type C overlap bottom and left
426  Afinx=xextent1;
427  Afiny=SimH;
428  Bfinx=SimW;
429  Cfinx=xextent1;
430  Dfinx=SimW;
431  Dfiny=SimH;
432  }
433  else
434  {
435  // Type A overlap left edge
436  Afinx=xextent1;
437  Afiny=yextent0;
438  Dfinx=SimW;
439  }
440  }
441  // the default is:
442  // Type D no overlap
443 
444 
445  // A Loop
446  for (int i=0; i<Afinx; i++)
447  {
448  for (int j=y; j<Afiny; j++)
449  {
450  // Get the polyref
451  int PRef = m_OurLandscape->SupplyPolyRefIndex(i,j);
452  // check if we have had this one already
454  bool found=false;
455  for (int k=0; k<NoPolygons; k++)
456  {
457  if (PolyRefData[k][0]==PRef)
458  {
459  PolyRefData[k][1]++;
460  found = true;
461  break;
462  }
463  }
464  if (!found)
465 //*/
466  {
467  // don't have this one so get the height & type to the PolyDatas arrays
468  PolyRefData[NoPolygons][0]=PRef;
469  PolyRefData[NoPolygons][1]=1;
470  NoPolygons++;
471  }
472  }
473  }
474  // B Loop
475  for (int i=x; i<Bfinx; i++)
476  {
477  for (int j=0; j<yextent1; j++)
478  {
479  // Get the polyref
480  int PRef = m_OurLandscape->SupplyPolyRefIndex(i,j);
481  // check if we have had this one already
482 /*
483  int index=-1;
484  for (int k=0; k<NoPolygons; k++)
485  {
486  if (PolyRefData[k][0]==PRef)
487  {
488  index=k;
489  break;
490  }
491  }
492  if (index!=-1)
493  {
494  PolyRefData[index][1]++;
495  }
496  else
497 */
499  bool found=false;
500  for (int k=0; k<NoPolygons; k++)
501  {
502  if (PolyRefData[k][0]==PRef)
503  {
504  PolyRefData[k][1]++;
505  found = true;
506  break;
507  }
508  }
509  if (!found)
510 //*/
511  {
512  // don't have this one so get the height & type to the PolyDatas arrays
513  PolyRefData[NoPolygons][0]=PRef;
514  PolyRefData[NoPolygons][1]=1;
515  NoPolygons++;
516  }
517  }
518  }
519  // C Loop
520  for (int i=0; i<Cfinx; i++)
521  {
522  for (int j=0; j<yextent1; j++)
523  {
524  // Get the polyref
525  int PRef = m_OurLandscape->SupplyPolyRefIndex(i,j);
526  // check if we have had this one already
527 /*
528  int index=-1;
529  for (int k=0; k<NoPolygons; k++)
530  {
531  if (PolyRefData[k][0]==PRef)
532  {
533  index=k;
534  break;
535  }
536  }
537  if (index!=-1)
538  {
539  PolyRefData[index][1]++;
540  }
541  else
542 */
544  bool found=false;
545  for (int k=0; k<NoPolygons; k++)
546  {
547  if (PolyRefData[k][0]==PRef)
548  {
549  PolyRefData[k][1]++;
550  found = true;
551  break;
552  }
553  }
554  if (!found)
555 //*/
556  {
557  // Don't have this one so get the height & type to the PolyDatas arrays
558  PolyRefData[NoPolygons][0]=PRef;
559  PolyRefData[NoPolygons][1]=1;
560  NoPolygons++;
561  }
562  }
563  }
564  // D Loop
565  int last=-99999;
566  int k_index=-1;
567  for (int i=x; i<Dfinx; i++)
568  {
569  for (int j=y; j<Dfiny; j++)
570  {
571  // Get the polyref
572  int PRef = m_OurLandscape->SupplyPolyRefIndex(i,j);
573  // check if we have had this one already
574  if (last==PRef)
575  {
576  PolyRefData[k_index][1]++;
577  }
578  else
579  {
580 
581  bool found=false;
582  for (int k=0; k<NoPolygons; k++)
583  {
584  if (PolyRefData[k][0]==PRef)
585  {
586  PolyRefData[k][1]++;
587  found = true;
588  last = PRef;
589  k_index = k;
590  break;
591  }
592  }
593  if (!found)
594  {
595  // don't have this one so get the height & type to the PolyDatas arrays
596  PolyRefData[NoPolygons][0]=PRef;
597  PolyRefData[NoPolygons][1]=1;
598  NoPolygons++;
599  }
600  }
601  }
602  }
603  // End of search algorithm
604  /* for each polygon get the quality and multiply by amount of that polygon in the territory sum this to get overall quality */
605  for ( int i=0; i<NoPolygons; i++)
606  {
607  quality+= PolyRefData[i][1]*m_OurPopulation->GetHabitatQuality(PolyRefData[i][0]);
608  }
609 // return quality;
610 
612  if (Voles > a_ddep) quality /= (Voles-a_ddep);
613  // return the total quality
614  return quality;
615 }
int SupplyPolyRefIndex(int a_x, int a_y)
Definition: landscape.h:1493
int m_Location_y
Definition: PopulationManager.h:228
int m_Location_x
Definition: PopulationManager.h:225
Landscape * m_OurLandscape
Definition: PopulationManager.h:229
int SimH
Definition: vole_all.h:210
int SimW
Definition: vole_all.h:210
unsigned int m_MinTerrRange
Definition: vole_all.h:164
int m_TerrRange
Definition: vole_all.h:172
Vole_Population_Manager * m_OurPopulation
Definition: vole_all.h:408
double GetHabitatQuality(int a_index)
Definition: VolePopulationManager.h:233
int SupplyHowManyVoles(unsigned p_x, unsigned p_y, unsigned p_size)
Definition: VolePopulationManager.cpp:1162

References Vole_Population_Manager::GetHabitatQuality(), TAnimal::m_Location_x, TAnimal::m_Location_y, m_MinTerrRange, TAnimal::m_OurLandscape, m_OurPopulation, m_TerrRange, SimH, SimW, Vole_Population_Manager::SupplyHowManyVoles(), and Landscape::SupplyPolyRefIndex().

Referenced by Vole_Male::CanFeed(), Vole_JuvenileMale::Dispersal(), Vole_Male::Dispersal(), Vole_JuvenileFemale::Dispersal(), Vole_JuvenileMale::st_Eval_n_Explore(), Vole_Male::st_Eval_n_Explore(), Vole_JuvenileFemale::st_Evaluate_n_Explore(), Vole_Female::st_Evaluate_n_Explore(), and Vole_Female::st_Special_Explore().

◆ CheckTraps()

void Vole_Base::CheckTraps ( )
protected
2801 {
2802  if (m_OurLandscape->SupplyYearNumber() < 10 ) return; // Don't sample until the population has stabilised
2803  int r = m_TerrRange;
2804  int vx = m_Location_x;
2805  int vy = m_Location_y;
2806  for (int rad = 0; rad <r; rad++) {
2807  // Two Loops
2808  for (int x = vx-rad; x<=vx+rad; x++) {
2809  int y = vy + rad;
2810  if (m_OurPopulation->IsTrap( x, y ) ) {
2811  if (random(1) == 0) {
2812  m_intrappos.m_x = x;
2813  m_intrappos.m_y = y;
2816  m_intrappos.m_inAtrap = true;
2817  return;
2818  }
2819  }
2820  y = vy - rad;
2821  if (m_OurPopulation->IsTrap( x, y ) ) {
2822  if (random(1) == 0) {
2823  m_intrappos.m_x = x;
2824  m_intrappos.m_y = y;
2827  m_intrappos.m_inAtrap = true;
2828  return;
2829  }
2830  }
2831  }
2832  for (int y = vy-(rad-1); y<=vy+(rad-1); y++) {
2833  int x = vx + rad;
2834  if (m_OurPopulation->IsTrap( x, y ) ) {
2835  if (random(1) == 0) {
2836  m_intrappos.m_x = x;
2837  m_intrappos.m_y = y;
2840  m_intrappos.m_inAtrap = true;
2841  return;
2842  }
2843  }
2844  x = vx - rad;
2845  if (m_OurPopulation->IsTrap( x, y ) ) {
2846  if (random(1) == 0) {
2847  m_intrappos.m_x = x;
2848  m_intrappos.m_y = y;
2851  m_intrappos.m_inAtrap = true;
2852  return;
2853  }
2854  }
2855  }
2856  }
2857 }
int random(int a_range)
Definition: ALMaSS_CmdLine.cpp:142
unsigned m_x
Definition: PopulationManager.h:172
unsigned m_y
Definition: PopulationManager.h:173
TTypesOfLandscapeElement m_EleType
Definition: PopulationManager.h:174
TTypesOfVegetation m_VegType
Definition: PopulationManager.h:175
bool m_inAtrap
Definition: vole_all.h:115
int SupplyYearNumber(void)
Definition: landscape.h:1616
TTypesOfVegetation SupplyVegType(int a_x, int a_y)
Definition: landscape.h:1321
TTypesOfLandscapeElement SupplyElementType(int a_polyref)
Definition: landscape.h:1110
InTrapPosition m_intrappos
Definition: vole_all.h:214
bool IsTrap(int p_x, int p_y)
Definition: VolePopulationManager.h:207

References Vole_Population_Manager::IsTrap(), AnimalPosition::m_EleType, InTrapPosition::m_inAtrap, m_intrappos, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, m_OurPopulation, m_TerrRange, AnimalPosition::m_VegType, AnimalPosition::m_x, AnimalPosition::m_y, random(), Landscape::SupplyElementType(), Landscape::SupplyVegType(), and Landscape::SupplyYearNumber().

Referenced by Vole_JuvenileMale::st_Eval_n_Explore(), Vole_Male::st_Eval_n_Explore(), Vole_JuvenileFemale::st_Evaluate_n_Explore(), and Vole_Female::st_Evaluate_n_Explore().

◆ CopyMyself()

void Vole_Base::CopyMyself ( VoleObject  a_vtype)

Duplicates a vole.

Method used to duplicate a vole - most commonly used for experimental manipulation of populations e.g. return rate experiments

313  {
314  struct_Vole_Adult* av;
315  av = new struct_Vole_Adult;
316  av->VPM = m_OurPopulation;
317  av->L = m_OurLandscape;
318  av->m_flag=true; // Used to signal pesticide effect to CreateObjects
322  av->x = ((m_Location_x+1)%m_OurPopulation->SimW);
323  av->y = ((m_Location_y)%m_OurPopulation->SimH);
324  // Do the genetics
326  m_OurPopulation->CreateObjects(a_vtype,this,av,1);
327  // object will be destroyed by death state
328  // but must let Dad know anyway
329  delete av;
330 }
void Recombine(GeneticMaterial *Gen21, GeneticMaterial *Gene2)
Definition: GeneticMaterial.cpp:338
int SupplyPolyRef(int a_x, int a_y)
Definition: landscape.h:1488
int SimH
Definition: PopulationManager.h:511
int SimW
Definition: PopulationManager.h:511
GeneticMaterial m_MyGenes
Definition: vole_all.h:213
void CreateObjects(VoleObject ob_type, TAnimal *pvo, struct_Vole_Adult *as, int number)
Definition: VolePopulationManager.cpp:3455
A struct for passing data to create a new vole.
Definition: vole_all.h:123
GeneticMaterial Genes
Definition: vole_all.h:141
Vole_Population_Manager * VPM
Definition: vole_all.h:139
bool m_flag
Definition: vole_all.h:142
int ElemBorn
Definition: vole_all.h:132
int PolyRefBorn
Definition: vole_all.h:131
int VegBorn
Definition: vole_all.h:133

References Vole_Population_Manager::CreateObjects(), struct_Vole_Adult::ElemBorn, struct_Vole_Adult::Genes, struct_Vole_Adult::L, struct_Vole_Adult::m_flag, TAnimal::m_Location_x, TAnimal::m_Location_y, m_MyGenes, TAnimal::m_OurLandscape, m_OurPopulation, struct_Vole_Adult::PolyRefBorn, GeneticMaterial::Recombine(), Population_Manager::SimH, Population_Manager::SimW, Landscape::SupplyElementType(), Landscape::SupplyPolyRef(), Landscape::SupplyVegType(), struct_Vole_Adult::VegBorn, struct_Vole_Adult::VPM, struct_Vole_Adult::x, and struct_Vole_Adult::y.

Referenced by Vole_Population_Manager::Catastrophe().

◆ DoWalking()

void Vole_Base::DoWalking ( int  p_Distance,
int &  p_Vector,
int &  vx,
int &  vy 
)
protected

Walking.

This method does the actual stepping - there is no look ahead here, so steps are taken one at a time based on the habitat type and vector given.

954 {
955  int t[5], q[5];
957  t[0] = p_Vector;
958  t[1] = (p_Vector+1) & 0x07;
959  t[2] = (p_Vector+7) & 0x07;
960  t[3] = (p_Vector+2) & 0x07;
961  t[4] = (p_Vector+6) & 0x07;
962 //*/
963  for (int i=0; i<p_Distance; i++)
964  {
965  // test the squares at Vector, Vector+1+2, Vector-1-2
966  // They have either a quality or are inaccessible (water,buildings)
967  // if can go to one of these squares then pick the best one
968  // if all or some are equal then take a random pick.
969  // if all are 'bad' then add or subtract one from vector and try again
970 
971 /* t[0] = p_Vector;
972  t[1] = (p_Vector+1) & 0x07;
973  t[2] = (p_Vector+7) & 0x07;
974  t[3] = (p_Vector+2) & 0x07;
975  t[4] = (p_Vector+6) & 0x07; */
976 
977  q[0] = MoveQuality((vx+Vector_x[t[0]]),(vy+Vector_y[t[0]]));
978  q[1] = MoveQuality((vx+Vector_x[t[1]]),(vy+Vector_y[t[1]]));
979  q[2] = MoveQuality((vx+Vector_x[t[2]]),(vy+Vector_y[t[2]]));
980  q[3] = MoveQuality((vx+Vector_x[t[3]]),(vy+Vector_y[t[3]]));
981  q[4] = MoveQuality((vx+Vector_x[t[4]]),(vy+Vector_y[t[4]]));
983  {
984  // allow a mistake once in a while
985  for (int j=1; j<5; j++) q[j]=-1;
986  }
987  // Now pick the best of these
988  int best = q[0];
989  int score=1;
990  for (int ii=1; ii<5; ii++)
991  {
992  if (q[ii]>best)
993  {
994  best=q[ii];
995  score=1;
996  }
997  else if (q[ii]==best) score++;
998  }
999  if (best==-1)
1000  {
1001  // can't go anywhere so change the vector
1002  if (random(2)) ++p_Vector; else (--p_Vector);
1003  p_Vector&=0x07;
1005  t[0] = p_Vector;
1006  t[1] = (p_Vector+1) & 0x07;
1007  t[2] = (p_Vector+7) & 0x07;
1008  t[3] = (p_Vector+2) & 0x07;
1009  t[4] = (p_Vector+6) & 0x07;
1010 //*/
1011  }
1012  else
1013  {
1014  // Can go to one of score squares
1015  int scored=random(score); // pick one
1016  int loop=0;
1017  for (int ii=0; ii<5; ii++)
1018  {
1019  if (best==q[ii]) loop++; // count the squares with 'best' quality
1020  if (loop>scored)
1021  {
1022  loop=ii; // go to i-square
1023  break;
1024  }
1025  }
1026  // change co-ordinates
1027  vx+=Vector_x[t[loop]];
1028  vy+=Vector_y[t[loop]];
1029  }
1030  }
1031 }
const int Vector_x[8]
boost::variate_generator< base_generator_type &, boost::uniform_real<> > g_rand_uni
double MoveToLessFavourable
Definition: VolePopulationManager.cpp:157
const int Vector_y[8]
int MoveQuality(int p_x, int p_y)
Test a location for quality while moving.
Definition: Vole_all.cpp:1207

References g_rand_uni, MoveQuality(), MoveToLessFavourable, random(), Vector_x, and Vector_y.

Referenced by MoveTo().

◆ DoWalkingCorrect()

void Vole_Base::DoWalkingCorrect ( int  p_Distance,
int &  p_Vector,
int &  vx,
int &  vy 
)
protected

Walking where there is a danger of stepping off the world.

This method does the actual stepping - there is no look ahead here, so steps are taken one at a time based on the habitat type and vector given.
This version corrects coords for wrap around. This is slower so is only called when necessary.

1042 {
1043  int t[5], q[5];
1045  t[0] = p_Vector;
1046  t[1] = (p_Vector+1) & 0x07;
1047  t[2] = (p_Vector+7) & 0x07;
1048  t[3] = (p_Vector+2) & 0x07;
1049  t[4] = (p_Vector+6) & 0x07;
1050  //*/
1051  for (int i=0; i<p_Distance; i++)
1052  {
1053  // test the squares at Vector, Vector+1+2, Vector-1-2
1054  // They have either a quality or are inaccessible (water,buildings)
1055  // if can go to one of these squares then pick the best one
1056  // if all or some are equal then take a random pick.
1057  // if all are 'bad' then add or subtract one from vector and try again
1058  /* t[0] = p_Vector;
1059  t[1] = (p_Vector+1) & 0x07;
1060  t[2] = (p_Vector+7) & 0x07;
1061  t[3] = (p_Vector+2) & 0x07;
1062  t[4] = (p_Vector+6) & 0x07; */
1063  q[0] = MoveQuality((vx+Vector_x[t[0]])%SimW, (vy+Vector_y[t[0]])%SimH);
1064  q[1] = MoveQuality((vx+Vector_x[t[1]])%SimW,(vy+Vector_y[t[1]])%SimH);
1065  q[2] = MoveQuality((vx+Vector_x[t[2]])%SimW,(vy+Vector_y[t[2]])%SimH);
1066  q[3] = MoveQuality((vx+Vector_x[t[3]])%SimW,(vy+Vector_y[t[3]])%SimH);
1067  q[4] = MoveQuality((vx+Vector_x[t[4]])%SimW,(vy+Vector_y[t[4]])%SimH);
1069  {
1070  // allow a mistake once in a while
1071  for (int j=1; j<5; j++) q[j]=-1;
1072  }
1073  // Now pick the best of these
1074  int best = q[0];
1075  int score=1;
1076  for (int ii=1; ii<5; ii++)
1077  {
1078  if (q[ii]>best)
1079  {
1080  best=q[ii];
1081  score=1;
1082  }
1083  else
1084  if (q[ii]==best) score++;
1085  }
1086  if (best==-1)
1087  {
1088  // can't go anywhere so change the vector
1089  if (random(2)) ++p_Vector; else (--p_Vector);
1090  p_Vector&=0x07;
1091  // /*
1092  t[0] = p_Vector;
1093  t[1] = (p_Vector+1) & 0x07;
1094  t[2] = (p_Vector+7) & 0x07;
1095  t[3] = (p_Vector+2) & 0x07;
1096  t[4] = (p_Vector+6) & 0x07; //*/
1097  }
1098  else
1099  {
1100  // Can go to one of score squares
1101  int scored=random(score); // pick one
1102  int loop=0;
1103  for (int ii=0; ii<5; ii++)
1104  {
1105  if (best==q[ii]) loop++; // count the squares with 'best' quality
1106  if (loop>scored)
1107  {
1108  loop=ii; // go to i-square
1109  break;
1110  }
1111  }
1112  // change co-ordinates
1113  vx+=Vector_x[t[loop]];
1114  vy+=Vector_y[t[loop]];
1115  }
1116  }
1117 }

References g_rand_uni, MoveQuality(), MoveToLessFavourable, random(), SimH, SimW, Vector_x, and Vector_y.

Referenced by MoveTo().

◆ EndStep()

void Vole_Base::EndStep ( void  )
virtual

All voles age at the end of the day.

Reimplemented from TAnimal.

Reimplemented in Vole_JuvenileFemale, Vole_Male, and Vole_JuvenileMale.

337 {
338  m_Age++; // Once a day increment m_Age
339 }
int m_Age
Definition: vole_all.h:178

References m_Age.

◆ Escape()

void Vole_Base::Escape ( int  p_Vector,
int  p_Distance 
)
protected

Dispersal - directed movement.

This works like MoveTo above, but with a rather more directed movement aimed at moving further from the start point.

1128 {
1129  // This will alter m_Location_x & m_Location_y
1130  // it will give a very directed movement towards p_Vector
1131 
1132  // p_Vector gives the preferred direction (0-7)
1133  // p_Distance is the number of steps
1134  int vx = m_Location_x+SimW;
1135  int vy = m_Location_y+SimH;
1136 // int counter = 0;
1137  for (int i=0; i<p_Distance; i++)
1138  {
1139  // test the squares at Vector, Vector+1+2, Vector-1-2
1140  // They have either a quality or are inaccessible (water,buildings)
1141  // if can go to one of these squares then pick the best one
1142  // if all or some are equal then take a random pick.
1143  // if all are 'bad' then add or subtract one from p_Vector and try again
1144 // counter ++;
1145  int t[3], q[3];
1146  t[0] = p_Vector;
1147  t[1] = (p_Vector+1) & 0x07;
1148  t[2] = (p_Vector+7) & 0x07;
1149  q[0] = MoveQuality((vx+Vector_x[t[0]])%SimW,(vy+Vector_y[t[0]])%SimH);
1150  q[1] = MoveQuality((vx+Vector_x[t[1]])%SimW,(vy+Vector_y[t[1]])%SimH);
1151  q[2] = MoveQuality((vx+Vector_x[t[2]])%SimW,(vy+Vector_y[t[2]])%SimH);
1152  // Now pick the best of these
1153  int noscore=0;
1154  for (int ii=0; ii<3; ii++)
1155  {
1156  if (q[ii]==-1)
1157  {
1158  noscore++;
1159  }
1160  }
1161  if (noscore==3)
1162  {
1163  // can't go anywhere so change the vector
1164  if (random(2)) p_Vector++; else p_Vector--;
1165  }
1166  else
1167  {
1168  // Can go to at least one of score squares
1169  // try the middle first
1170  int loop=0;
1171  if (q[0]==-1)
1172  {
1173  // otherwise randomly try one side or other
1174  // it must be possible to go to one of these
1175  int which=random(2);
1176  if (which==1)
1177  {
1178  if (q[1]!=-1) loop=1; else loop=2;
1179  }
1180  else
1181  {
1182  if (q[2]!=-1) loop=2; else loop=1;
1183  }
1184  }
1185  // change co-ordinates
1186  vx+=Vector_x[t[loop]];
1187  vy+=Vector_y[t[loop]];
1188  }
1189  }
1190  // alter the voles location
1191  FreeLocation();
1192  m_Location_x=vx%SimW;
1193  m_Location_y=vy%SimH;
1194  SetLocation();
1195 }
virtual void SetLocation()
Definition: vole_all.h:439
virtual void FreeLocation()
Definition: vole_all.h:440

References FreeLocation(), TAnimal::m_Location_x, TAnimal::m_Location_y, MoveQuality(), random(), SetLocation(), SimH, SimW, Vector_x, and Vector_y.

◆ FreeLocation()

virtual void Vole_Base::FreeLocation ( )
inlineprotectedvirtual

Reimplemented in Vole_JuvenileFemale, and Vole_JuvenileMale.

440 {};

Referenced by Escape(), MoveTo(), and st_Dying().

◆ GetDirectFlag()

int Vole_Base::GetDirectFlag ( )
inline

Genetic functionality

392 { return m_MyGenes.GetDirectFlag(); }
uint32 GetDirectFlag()
Definition: GeneticMaterial.cpp:191

References GeneticMaterial::GetDirectFlag(), and m_MyGenes.

Referenced by Vole_Population_Manager::GeneticsOutputFile(), and Vole_Population_Manager::ImpactedProbe().

◆ GetFertile()

bool Vole_Base::GetFertile ( )
inline

Get the male vole fertility.

Primarily used in ecotoxicological simulations where toxic effects may render the vole sterile.

424  {
428  return m_fertile;
429  }
bool m_fertile
Flag indicating the fertility state (true means fertile)
Definition: vole_all.h:194

References m_fertile.

Referenced by Vole_Female::st_Mating().

◆ GetGeneticFlag()

int Vole_Base::GetGeneticFlag ( )
inline

Genetic functionality

390 { return m_MyGenes.GetGeneticFlag(); }
uint32 GetGeneticFlag()
Definition: GeneticMaterial.cpp:187

References GeneticMaterial::GetGeneticFlag(), and m_MyGenes.

Referenced by Vole_Population_Manager::GeneticsOutputFile(), and Vole_Population_Manager::ImpactedProbe().

◆ GetLocation()

virtual bool Vole_Base::GetLocation ( int  ,
int   
)
inlineprotectedvirtual

Reimplemented in Vole_JuvenileFemale, and Vole_JuvenileMale.

441 {return false;};

Referenced by MoveTo().

◆ Init()

void Vole_Base::Init ( struct_Vole_Adult p_aVoleStruct)
virtual
241  {
242  m_Location_x = p_aVoleStruct->x;
243  m_Location_y = p_aVoleStruct->y;
244  m_OurLandscape = p_aVoleStruct->L;
245  m_CurrentStateNo = 0;
246  m_OurPopulation = p_aVoleStruct->VPM;
247  m_Mature = false;
248  m_Age = 0;
249  m_Weight = 0.5;
250  m_NoOfYoungTotal = 0;
251  m_DispVector = -1;
252  m_Have_Territory = false;
253  m_TerrRange = 0; // The size of the territory
254  m_MinTerrRange = 0;
255  m_Reserves = 3;
256  m_LifeSpan = (365 + 60) + int(g_rand_uni()*(30 * cfg_vole_LifeMonths.value())); //
258  m_intrappos.m_inAtrap = false;
259  m_BornLastYear = false;
260 
261  m_MyGenes = p_aVoleStruct->Genes;
265 
266  unsigned FatherIdNo = p_aVoleStruct->FatherId;
267  Set_FatherId(FatherIdNo);
268  unsigned MotherIdNo = p_aVoleStruct->MotherId;
269  Set_MotherId(MotherIdNo);
275  Set_BirthYear(p_aVoleStruct->BirthYear);
276 
279  if (m_MaxMaleTerritorySize < m_MinMaleTerritorySize) m_MaxMaleTerritorySize = m_MinMaleTerritorySize; // Corrects a bug caused by incorrect input settings
282  if (m_MaxFemaleTerritorySize < m_MinFemaleTerritorySize) m_MaxFemaleTerritorySize = m_MinFemaleTerritorySize; // Corrects a bug caused by incorrect input settings
288 #ifdef __VoleStarvationDays
289  m_StarvationDays = 0;
290  m_MaxStarvationDays = cfg_MaxStarvationDays.value();
291 #endif
292 #ifdef __VOLEPESTICIDEON
293  ClearPesticidLoad();
294  m_pesticideBioDegradeRate = cfg_volepcidebiodegredrate.value();
295  SetPesticideInfluenced1(false);
296  SetPesticideInfluenced2(false);
297  m_pesticideInfluenced3 = 0.0;
298 #endif
299  m_fertile = true;
300  }
static CfgInt cfg_vole_LifeMonths("VOLE_LIFEMONTHS", CFG_CUSTOM, 3)
static CfgInt cfg_MaxFemaleTerrSize("VOLE_MAXFEMALETERRITORYSIZE", CFG_CUSTOM, 8)
CfgInt cfg_MinMaleTerritorySize("VOLE_MINMALETERRITORYSIZE", CFG_CUSTOM, 9)
static CfgInt cfg_MaxStarvationDays("VOLE_MAXSTARVATIONDAYS", CFG_CUSTOM, 29)
const double MaxWeightF
Definition: Vole_all.cpp:135
const int MinReproWeightF
Definition: Vole_all.cpp:151
const unsigned MinReproWeightM
Definition: Vole_all.cpp:149
CfgInt cfg_MinFemaleTerritorySize("VOLE_MINFEMALETERRITORYSIZE", CFG_CUSTOM, 8)
const double MaxWeightM
Definition: Vole_all.cpp:133
static CfgFloat cfg_volepcidebiodegredrate("VOLE_PCIDE_BIODEGREDATIONRATE", CFG_CUSTOM, 0.0)
static CfgInt cfg_MaxMaleTerrSize("VOLE_MAXMALETERRITORYSIZE", CFG_CUSTOM, 23)
static CfgFloat cfg_vole_habqualscaler("VOLE_HABQUALSCALER", CFG_CUSTOM, 2.1)
double value(void)
Definition: configurator.h:118
int value(void)
Definition: configurator.h:98
int m_CurrentStateNo
The basic state number for all objects - '-1' indicates death.
Definition: PopulationManager.h:116
void Set_BirthYear(int BirthYear)
Definition: vole_all.h:302
int m_NoOfYoungTotal
Definition: vole_all.h:200
bool m_Mature
Definition: vole_all.h:176
double m_Weight
Definition: vole_all.h:192
void Set_YBorn(int a_Location_y)
Definition: vole_all.h:313
int m_DispVector
Definition: vole_all.h:202
static double m_MinMVoleHabQual
Definition: vole_all.h:228
static unsigned int m_MaxFemaleTerritorySize
Definition: vole_all.h:218
static double m_FemaleTerritoryRangeSlope
Definition: vole_all.h:232
void Set_PolyRefBorn(int a_Location_x, int a_Location_y)
Definition: vole_all.h:327
static unsigned int m_MinFemaleTerritorySize
Definition: vole_all.h:222
bool m_BornLastYear
A flag set if the female was born the year before.
Definition: vole_all.h:162
void Set_MotherId(unsigned MotherIdNo)
Definition: vole_all.h:305
static unsigned int m_MaxMaleTerritorySize
Definition: vole_all.h:216
int m_Reserves
Definition: vole_all.h:206
static unsigned int m_MinMaleTerritorySize
Definition: vole_all.h:220
static double m_MaleTerritoryRangeSlope
Definition: vole_all.h:230
bool m_Have_Territory
Definition: vole_all.h:204
int m_LifeSpan
Definition: vole_all.h:190
unsigned IDNo
Definition: vole_all.h:208
static double m_MinFVoleHabQual
Definition: vole_all.h:224
void Set_VegBorn(int a_Location_x, int a_Location_y)
Definition: vole_all.h:321
TTypeOfVoleState CurrentVState
Definition: vole_all.h:407
static double m_MinJMVoleHabQual
Definition: vole_all.h:226
void Set_XBorn(int a_Location_x)
Definition: vole_all.h:311
void Set_ElemBorn(int a_Location_x, int a_Location_y)
Definition: vole_all.h:315
void Set_FatherId(unsigned FatherIdNo)
Definition: vole_all.h:307
unsigned IDNumber
Definition: VolePopulationManager.h:222
int FatherId
Definition: vole_all.h:135
int MotherId
Definition: vole_all.h:136
int BirthYear
Definition: vole_all.h:134
@ tovs_InitialState
Definition: vole_all.h:57

References struct_Vole_Adult::BirthYear, cfg_MaxFemaleTerrSize, cfg_MaxMaleTerrSize, cfg_MaxStarvationDays, cfg_MinFemaleTerritorySize, cfg_MinMaleTerritorySize, cfg_vole_habqualscaler, cfg_vole_LifeMonths, cfg_volepcidebiodegredrate, CurrentVState, struct_Vole_Adult::FatherId, g_rand_uni, struct_Vole_Adult::Genes, IDNo, Vole_Population_Manager::IDNumber, struct_Vole_Adult::L, m_Age, m_BornLastYear, TALMaSSObject::m_CurrentStateNo, m_DispVector, m_FemaleTerritoryRangeSlope, m_fertile, m_Have_Territory, InTrapPosition::m_inAtrap, m_intrappos, m_LifeSpan, TAnimal::m_Location_x, TAnimal::m_Location_y, m_MaleTerritoryRangeSlope, m_Mature, m_MaxFemaleTerritorySize, m_MaxMaleTerritorySize, m_MinFemaleTerritorySize, m_MinFVoleHabQual, m_MinJMVoleHabQual, m_MinMaleTerritorySize, m_MinMVoleHabQual, m_MinTerrRange, m_MyGenes, m_NoOfYoungTotal, TAnimal::m_OurLandscape, m_OurPopulation, m_Reserves, m_TerrRange, m_Weight, MaxWeightF, MaxWeightM, MinReproWeightF, MinReproWeightM, struct_Vole_Adult::MotherId, Set_BirthYear(), Set_ElemBorn(), Set_FatherId(), Set_MotherId(), Set_PolyRefBorn(), Set_VegBorn(), Set_XBorn(), Set_YBorn(), Population_Manager::SimH, SimH, Population_Manager::SimW, SimW, tovs_InitialState, CfgInt::value(), CfgFloat::value(), struct_Vole_Adult::VPM, struct_Vole_Adult::x, and struct_Vole_Adult::y.

Referenced by ReInit(), Vole_JuvenileMale::ReInit(), Vole_Male::ReInit(), Vole_JuvenileFemale::ReInit(), Vole_Female::ReInit(), and Vole_Base().

◆ MortalityTest()

bool Vole_Base::MortalityTest ( )
virtual

Do a mortality test.

Takes both physiological lifespan and background mortality into account to determine whether the vole should die - repeated calls increase the risk of dying

Reimplemented in Vole_Male.

363 {
364  // returns true if the vole should die
365  if (g_rand_uni() < g_DailyMortChance) {
366  return true;
367  }
368  // returns true if the vole should die
369  return false;
370 }
double g_DailyMortChance
Definition: Vole_all.cpp:189

References g_DailyMortChance, and g_rand_uni.

Referenced by Vole_JuvenileMale::BeginStep(), and Vole_JuvenileFemale::BeginStep().

◆ MoveQuality()

int Vole_Base::MoveQuality ( int  p_x,
int  p_y 
)
protected

Test a location for quality while moving.

Returns the quality of a patch of habitat at p_x,p_y.
Can't walk through another vole though - so test location first.

1208 {
1209  if (m_OurPopulation->m_VoleMap->GetMapValue(p_x,p_y)!=NULL) return -1;
1210  // Nobody there so carry on
1211  int poly_index=m_OurLandscape->SupplyPolyRefIndex(p_x,p_y);
1212  int score = -9999;
1214  switch (tole)
1215  {
1216  case tole_NaturalGrassDry: // 110
1217  case tole_NaturalGrassWet: // 110
1218  case tole_BeetleBank:
1219  score=4;
1220  break;
1221  case tole_PermPasture: // 35
1222  if (m_OurLandscape->SupplyGrazingPressureVector(poly_index) > 0 ) score=1; else score=4;
1223  break;
1224  case tole_PermPastureLowYield: // 35
1225  if (m_OurLandscape->SupplyGrazingPressureVector(poly_index) > 0 ) score = 1; else score = 4;
1226  break;
1228  if (m_OurLandscape->SupplyGrazingPressureVector(poly_index) > 0 ) score = 2; else score = 4;
1229  break;
1230  case tole_Orchard: // 56
1231  // Quality depends on when it was mown
1232  if (m_OurLandscape->SupplyJustMownVector(poly_index)) score=0; else
1233  {
1234  if (m_OurLandscape->SupplyVegCoverVector(poly_index)<0.8) score = 4;
1235  else if (m_OurLandscape->SupplyVegHeightVector(poly_index)<=40) score = 4;
1236  else score = 4;
1237  }
1238 
1239  break;
1240  case tole_MownGrass: // 58
1241  // Quality depends on when it was mown
1242  if (m_OurLandscape->SupplyJustMownVector(poly_index)) score=1; else score=4;
1243  break;
1244  case tole_OrchardBand: // 57
1245  score = 4 - (int) (0.6*m_OurLandscape->SupplyJustSprayedVector(poly_index));
1246  break;
1247  case tole_RoadsideSlope:
1248  case tole_Railway: // 118
1249  case tole_FieldBoundary: // 160
1250  case tole_RoadsideVerge: // 13
1251  case tole_HedgeBank:
1253  case tole_YoungForest: // 60
1254  case tole_Vildtager:
1255  case tole_Wasteland:
1256  score = 4;
1257  break;
1258  case tole_Saltmarsh: // 95
1259  case tole_Marsh: // 95
1260  case tole_Scrub: // 70
1261  case tole_Heath:
1262  case tole_Hedges: // 130 (internal ALMaSS representation for Hedges)
1263  case tole_RiversidePlants: // 98
1264  case tole_PitDisused: // 75
1265  case tole_MixedForest: // 60
1266  case tole_DeciduousForest: // 40
1267  case tole_Copse:
1268  score=3;
1269  break;
1270  case tole_RiversideTrees: // 97
1271  case tole_ConiferousForest: // 50
1273  case tole_Parkland:
1274  case tole_AmenityGrass:
1275  case tole_WoodyEnergyCrop:
1276  case tole_IndividualTree:
1277  score=2;
1278  break;
1279  case tole_Garden: //11
1280  case tole_Track: // 123
1281  case tole_SmallRoad: // 122
1282  case tole_LargeRoad: // 121
1283  case tole_BareRock:
1284  case tole_UrbanNoVeg:
1285  case tole_UrbanPark:
1286  case tole_SandDune:
1287  case tole_Churchyard: //204
1288  score=1;
1289  break;
1290  case tole_MetalledPath:
1291  case tole_Carpark:
1292  case tole_Stream:
1293  case tole_HeritageSite:
1294  case tole_Building: // 5
1295  case tole_ActivePit: // 115
1296  case tole_Freshwater: // 90
1297  case tole_FishFarm:
1298  case tole_Pond:
1299  case tole_River: // 96
1300  case tole_Saltwater: // 80
1301  case tole_Coast: // 100
1302  case tole_StoneWall: // 15
1303  case tole_Fence: //225
1304  case tole_WindTurbine:
1305  case tole_Pylon:
1306  score=-1;
1307  break;
1308  case tole_Field: // 20 & 30
1310  {
1312  switch (VType) {
1320  score = 3 - m_OurLandscape->SupplyGrazingPressureVector(poly_index);
1321  break;
1322  default:
1323  double cover = m_OurLandscape->SupplyVegCoverVector(poly_index);
1324  double height = m_OurLandscape->SupplyVegHeightVector(poly_index);
1325  if ((cover>0.80) && (height>40)) score = 3;
1326  if ((cover<0.50) || (height<10)) score = 0;
1327  else score = 2;
1328  }
1329  }
1330  break;
1331  case tole_Foobar: // 999 !! type unknown - should not happen
1332  default:
1333  static char errornum[20];
1334  sprintf(errornum, "%d", m_OurLandscape->SupplyElementTypeFromVector(poly_index));
1335  m_OurLandscape->Warn("Vole_Base:MoveQuality: Unknown tole_type",
1336  errornum);
1337  exit(1);
1338  }
1339  return score;
1340 }
a_type GetMapValue(unsigned x, unsigned y)
Definition: MovementMap.h:102
int SupplyJustSprayedVector(unsigned int a_index)
Definition: landscape.h:1270
double SupplyVegHeightVector(unsigned int a_index)
Definition: landscape.h:931
int SupplyGrazingPressureVector(unsigned int a_index)
Definition: landscape.h:1232
TTypesOfLandscapeElement SupplyElementTypeFromVector(unsigned int a_index)
Definition: landscape.h:1104
void Warn(std::string a_msg1, std::string a_msg2)
Definition: landscape.h:1579
bool SupplyJustMownVector(unsigned int a_index)
Definition: landscape.h:1258
TTypesOfVegetation SupplyVegTypeVector(unsigned int a_index)
Definition: landscape.h:1220
double SupplyVegCoverVector(unsigned int a_index)
Definition: landscape.h:1053
IDMap< TAnimal * > * m_VoleMap
Definition: VolePopulationManager.h:284
TTypesOfLandscapeElement
Definition: tole_declaration.h:36
@ tole_BareRock
Definition: tole_declaration.h:75
@ tole_PermPastureTussocky
Definition: tole_declaration.h:45
@ tole_Saltmarsh
Definition: tole_declaration.h:88
@ tole_WoodyEnergyCrop
Definition: tole_declaration.h:94
@ tole_Carpark
Definition: tole_declaration.h:85
@ tole_Coast
Definition: tole_declaration.h:67
@ tole_UrbanNoVeg
Definition: tole_declaration.h:78
@ tole_Stream
Definition: tole_declaration.h:89
@ tole_Saltwater
Definition: tole_declaration.h:66
@ tole_MixedForest
Definition: tole_declaration.h:53
@ tole_HeritageSite
Definition: tole_declaration.h:90
@ tole_RoadsideSlope
Definition: tole_declaration.h:83
@ tole_River
Definition: tole_declaration.h:65
@ tole_StoneWall
Definition: tole_declaration.h:56
@ tole_Parkland
Definition: tole_declaration.h:77
@ tole_NaturalGrassWet
Definition: tole_declaration.h:87
@ tole_NaturalGrassDry
Definition: tole_declaration.h:48
@ tole_UrbanPark
Definition: tole_declaration.h:79
@ tole_Pylon
Definition: tole_declaration.h:96
@ tole_PermanentSetaside
Definition: tole_declaration.h:46
@ tole_Garden
Definition: tole_declaration.h:58
@ tole_Pond
Definition: tole_declaration.h:101
@ tole_Scrub
Definition: tole_declaration.h:42
@ tole_Fence
Definition: tole_declaration.h:57
@ tole_Field
Definition: tole_declaration.h:43
@ tole_Copse
Definition: tole_declaration.h:82
@ tole_PermPasture
Definition: tole_declaration.h:47
@ tole_Hedges
Definition: tole_declaration.h:37
@ tole_Track
Definition: tole_declaration.h:59
@ tole_Heath
Definition: tole_declaration.h:70
@ tole_Freshwater
Definition: tole_declaration.h:64
@ tole_PitDisused
Definition: tole_declaration.h:50
@ tole_FieldBoundary
Definition: tole_declaration.h:40
@ tole_DeciduousForest
Definition: tole_declaration.h:52
@ tole_ActivePit
Definition: tole_declaration.h:63
@ tole_RiversidePlants
Definition: tole_declaration.h:49
@ tole_Building
Definition: tole_declaration.h:62
@ tole_RoadsideVerge
Definition: tole_declaration.h:38
@ tole_Vildtager
Definition: tole_declaration.h:99
@ tole_Orchard
Definition: tole_declaration.h:71
@ tole_MownGrass
Definition: tole_declaration.h:74
@ tole_YoungForest
Definition: tole_declaration.h:55
@ tole_OrchardBand
Definition: tole_declaration.h:73
@ tole_SmallRoad
Definition: tole_declaration.h:60
@ tole_Churchyard
Definition: tole_declaration.h:86
@ tole_BuiltUpWithParkland
Definition: tole_declaration.h:80
@ tole_AmenityGrass
Definition: tole_declaration.h:76
@ tole_PermPastureLowYield
Definition: tole_declaration.h:44
@ tole_HedgeBank
Definition: tole_declaration.h:68
@ tole_Railway
Definition: tole_declaration.h:39
@ tole_WindTurbine
Definition: tole_declaration.h:97
@ tole_ConiferousForest
Definition: tole_declaration.h:54
@ tole_SandDune
Definition: tole_declaration.h:81
@ tole_Wasteland
Definition: tole_declaration.h:92
@ tole_IndividualTree
Definition: tole_declaration.h:93
@ tole_Foobar
Definition: tole_declaration.h:111
@ tole_RiversideTrees
Definition: tole_declaration.h:51
@ tole_LargeRoad
Definition: tole_declaration.h:61
@ tole_UnsprayedFieldMargin
Definition: tole_declaration.h:72
@ tole_BeetleBank
Definition: tole_declaration.h:69
@ tole_MetalledPath
Definition: tole_declaration.h:84
@ tole_FishFarm
Definition: tole_declaration.h:102
@ tole_Marsh
Definition: tole_declaration.h:41
TTypesOfVegetation
Definition: tov_declaration.h:30
@ tov_PermanentGrassGrazed
Definition: tov_declaration.h:49
@ tov_CloverGrassGrazed2
Definition: tov_declaration.h:33
@ tov_OPermanentGrassGrazed
Definition: tov_declaration.h:44
@ tov_CloverGrassGrazed1
Definition: tov_declaration.h:32
@ tov_OCloverGrassSilage1
Definition: tov_declaration.h:43
@ tov_OCloverGrassGrazed2
Definition: tov_declaration.h:43
@ tov_OCloverGrassGrazed1
Definition: tov_declaration.h:43

References IDMap< a_type >::GetMapValue(), TAnimal::m_OurLandscape, m_OurPopulation, Vole_Population_Manager::m_VoleMap, Landscape::SupplyElementTypeFromVector(), Landscape::SupplyGrazingPressureVector(), Landscape::SupplyJustMownVector(), Landscape::SupplyJustSprayedVector(), Landscape::SupplyPolyRefIndex(), Landscape::SupplyVegCoverVector(), Landscape::SupplyVegHeightVector(), Landscape::SupplyVegTypeVector(), tole_ActivePit, tole_AmenityGrass, tole_BareRock, tole_BeetleBank, tole_Building, tole_BuiltUpWithParkland, tole_Carpark, tole_Churchyard, tole_Coast, tole_ConiferousForest, tole_Copse, tole_DeciduousForest, tole_Fence, tole_Field, tole_FieldBoundary, tole_FishFarm, tole_Foobar, tole_Freshwater, tole_Garden, tole_Heath, tole_HedgeBank, tole_Hedges, tole_HeritageSite, tole_IndividualTree, tole_LargeRoad, tole_Marsh, tole_MetalledPath, tole_MixedForest, tole_MownGrass, tole_NaturalGrassDry, tole_NaturalGrassWet, tole_Orchard, tole_OrchardBand, tole_Parkland, tole_PermanentSetaside, tole_PermPasture, tole_PermPastureLowYield, tole_PermPastureTussocky, tole_PitDisused, tole_Pond, tole_Pylon, tole_Railway, tole_River, tole_RiversidePlants, tole_RiversideTrees, tole_RoadsideSlope, tole_RoadsideVerge, tole_Saltmarsh, tole_Saltwater, tole_SandDune, tole_Scrub, tole_SmallRoad, tole_StoneWall, tole_Stream, tole_Track, tole_UnsprayedFieldMargin, tole_UrbanNoVeg, tole_UrbanPark, tole_Vildtager, tole_Wasteland, tole_WindTurbine, tole_WoodyEnergyCrop, tole_YoungForest, tov_CloverGrassGrazed1, tov_CloverGrassGrazed2, tov_OCloverGrassGrazed1, tov_OCloverGrassGrazed2, tov_OCloverGrassSilage1, tov_OPermanentGrassGrazed, tov_PermanentGrassGrazed, and Landscape::Warn().

Referenced by DoWalking(), DoWalkingCorrect(), Escape(), and Vole_Male::st_Eval_n_Explore().

◆ MoveTo()

void Vole_Base::MoveTo ( int  p_Vector,
int  p_Distance,
int  p_iterations 
)
protected

Movement.

Do an assessment of the quality of the voles territory, and move. This function does the same as the other CalcuateCarryingCapacity except that it alters the two values stand_x, stand_y to set them to be in the best polygon in the territory

Returns the mean of the qualities in the area covered by the territory (even if the vole does not have one)

Uses the algorithm for fast searching of square arrays with wrap around co-ordinates.
parameters = x,y starting coordinates top left
range = extent of the space to search
bottom left coordinate is therefore x+range, y+range
22/09/2000

For each polygon it gets the quality and multiplies by area of that polygon in the territory. This is summed for all polygons in the territory to get overall quality. This will alter m_Location_x & m_Location_y.
It will give a rather directed movement towards p_Vector.
Generally the vole will stay in the best habitat, but occasional mis-steps occur.
p_Vector gives the preferred direction (0-7), p_Distance is the number of steps.

908 {
909  int offset=p_Distance*p_iterations;
910  if ((m_Location_x-offset < 0) ||(m_Location_x+offset >= SimW) || (m_Location_y-offset < 0) ||(m_Location_y+offset >= SimH))
911  {
912  // Need correct coords
913  // Make sure that the coords can't become -ve
914  int vx = m_Location_x+SimW;
915  int vy = m_Location_y+SimH;
916  do
917  {
918  DoWalkingCorrect(p_Distance,p_Vector,vx,vy);
919  p_Distance=1;
920  } while ((GetLocation(vx%SimW,vy%SimH)) && (p_iterations-->0));
921  // alter the voles location (& correct coords)
922  FreeLocation();
923  m_Location_x=vx%SimW;
924  m_Location_y=vy%SimH;
925  SetLocation();
926  }
927  else
928  {
929  // Don't need correct coords
930  int vx = m_Location_x;
931  int vy = m_Location_y;
932  do
933  {
934  DoWalking(p_Distance,p_Vector,vx,vy);
935  p_Distance=1;
936  } while ((GetLocation(vx,vy)) && (p_iterations-->0));
937  // alter the voles location (& correct coords)
938  FreeLocation();
939  m_Location_x=vx;
940  m_Location_y=vy;
941  SetLocation();
942  }
943 }
void DoWalkingCorrect(int p_Distance, int &p_Vector, int &vx, int &vy)
Walking where there is a danger of stepping off the world.
Definition: Vole_all.cpp:1041
void DoWalking(int p_Distance, int &p_Vector, int &vx, int &vy)
Walking.
Definition: Vole_all.cpp:953
virtual bool GetLocation(int, int)
Definition: vole_all.h:441

References DoWalking(), DoWalkingCorrect(), FreeLocation(), GetLocation(), TAnimal::m_Location_x, TAnimal::m_Location_y, SetLocation(), SimH, and SimW.

Referenced by Vole_JuvenileMale::Dispersal(), Vole_Male::Dispersal(), Vole_JuvenileFemale::Dispersal(), Vole_JuvenileMale::st_JuvenileExplore(), and Vole_Female::st_Special_Explore().

◆ OnKilled()

virtual void Vole_Base::OnKilled ( )
inlinevirtual

Reimplemented in Vole_JuvenileFemale, and Vole_JuvenileMale.

404 {};

◆ ReInit()

void Vole_Base::ReInit ( struct_Vole_Adult p_aVoleStruct)
virtual

Reimplemented in Vole_Female, Vole_JuvenileFemale, Vole_Male, and Vole_JuvenileMale.

235  {
236  Init(p_aVoleStruct);
237  }

References Init().

◆ RodenticideIngestion()

void Vole_Base::RodenticideIngestion ( void  )
protectedvirtual
3344 {
3346  if (rodenticide>0) {
3347 
3348  // Todo effects
3349  }
3350  else return;
3351 }
double SupplyRodenticide(int a_x, int a_y)
Gets total rodenticide for a location.
Definition: Landscape.cpp:492

References TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, and Landscape::SupplyRodenticide().

◆ Set_Age()

void Vole_Base::Set_Age ( int  Age)
inline

Set our age

329 {m_Age=Age;}

References m_Age.

Referenced by Vole_Population_Manager::CreateObjects_Init().

◆ Set_BirthYear()

void Vole_Base::Set_BirthYear ( int  BirthYear)
inline

Set year of birth

302 {m_BirthYear = BirthYear;}
int m_BirthYear
Definition: vole_all.h:157

References m_BirthYear.

Referenced by Vole_Population_Manager::CreateObjects_Init(), and Init().

◆ Set_ElemBorn()

void Vole_Base::Set_ElemBorn ( int  a_Location_x,
int  a_Location_y 
)
inline

Set element type of birth location

316  {
317  TTypesOfLandscapeElement m_EBorn = m_OurLandscape->SupplyElementType(a_Location_x, a_Location_y);
319  }
int BackTranslateEleTypes(TTypesOfLandscapeElement EleReference)
Definition: landscape.h:1662
int m_ElemBorn
Definition: vole_all.h:186

References Landscape::BackTranslateEleTypes(), m_ElemBorn, TAnimal::m_OurLandscape, and Landscape::SupplyElementType().

Referenced by Init().

◆ Set_FatherId()

void Vole_Base::Set_FatherId ( unsigned  FatherIdNo)
inline

Set father ID

307 {m_FatherId = FatherIdNo;}; // ***TD***
unsigned m_FatherId
Definition: vole_all.h:168

References m_FatherId.

Referenced by Init().

◆ Set_MotherId()

void Vole_Base::Set_MotherId ( unsigned  MotherIdNo)
inline

Set mother ID

305 {m_MotherId = MotherIdNo;}; // ***TD***
unsigned m_MotherId
Definition: vole_all.h:166

References m_MotherId.

Referenced by Init().

◆ Set_NoYoungTot()

void Vole_Base::Set_NoYoungTot ( int  a_NoOfYoung)
inline

Sets the number of young produced by the female

309 {m_NoOfYoungTotal+=a_NoOfYoung;}; // ***TD***

References m_NoOfYoungTotal.

◆ Set_PolyRefBorn()

void Vole_Base::Set_PolyRefBorn ( int  a_Location_x,
int  a_Location_y 
)
inline

Set polygonref of birth location

327 {m_PolyRefBorn = (m_OurLandscape->SupplyPolyRef(a_Location_x, a_Location_y));}; // ***TD***
int m_PolyRefBorn
Definition: vole_all.h:184

References TAnimal::m_OurLandscape, m_PolyRefBorn, and Landscape::SupplyPolyRef().

Referenced by Init().

◆ Set_VegBorn()

void Vole_Base::Set_VegBorn ( int  a_Location_x,
int  a_Location_y 
)
inline

Set vegetation type of birth location

322  {
323  TTypesOfVegetation m_VBorn = (m_OurLandscape->SupplyVegType(a_Location_x, a_Location_y));
325  }
int BackTranslateVegTypes(TTypesOfVegetation VegReference)
Definition: landscape.h:1669
int m_VegBorn
Definition: vole_all.h:188

References Landscape::BackTranslateVegTypes(), TAnimal::m_OurLandscape, m_VegBorn, and Landscape::SupplyVegType().

Referenced by Init().

◆ Set_XBorn()

void Vole_Base::Set_XBorn ( int  a_Location_x)
inline

Set x-coordinate of birth location

311 {m_XBorn = a_Location_x;}; // ***TD***
int m_XBorn
Definition: vole_all.h:180

References m_XBorn.

Referenced by Init().

◆ Set_YBorn()

void Vole_Base::Set_YBorn ( int  a_Location_y)
inline

Set y-coordinate of birth location

313 {m_YBorn = a_Location_y;}; // ***TD***
int m_YBorn
Definition: vole_all.h:182

References m_YBorn.

Referenced by Init().

◆ SetBreedingSeason()

void Vole_Base::SetBreedingSeason ( bool  a_flag)
inline

Set Breeding Season flag.

296 { m_BreedingSeason = a_flag; }
static bool m_BreedingSeason
Definition: vole_all.h:247

References m_BreedingSeason.

◆ SetDirectFlag()

void Vole_Base::SetDirectFlag ( )
inline

Genetic functionality

void SetDirectFlag()
Definition: GeneticMaterial.cpp:173

References m_MyGenes, and GeneticMaterial::SetDirectFlag().

Referenced by Vole_Population_Manager::CreateObjects().

◆ SetFertile()

void Vole_Base::SetFertile ( bool  f)
inline

Set the male vole fertility.

Primarily used in ecotoxicological simulations where toxic effects may render the vole sterile.

414  {
418  m_fertile=f;
419  }

References m_fertile.

Referenced by Vole_Population_Manager::CreateObjects(), and Vole_Population_Manager::CreateObjects_Init().

◆ SetFree()

void Vole_Base::SetFree ( )
inline

Release vole from trap

380 { m_intrappos.m_inAtrap = false; }

References InTrapPosition::m_inAtrap, and m_intrappos.

Referenced by Vole_Population_Manager::DoFirst().

◆ SetGeneticFlag()

void Vole_Base::SetGeneticFlag ( )
inline

Genetic functionality

void SetGeneticFlag()
Definition: GeneticMaterial.cpp:169

References m_MyGenes, and GeneticMaterial::SetGeneticFlag().

Referenced by Vole_Population_Manager::CreateObjects().

◆ SetLocation()

virtual void Vole_Base::SetLocation ( )
inlineprotectedvirtual

Reimplemented in Vole_JuvenileFemale, and Vole_JuvenileMale.

439 {};

Referenced by Escape(), and MoveTo().

◆ Setm_Mature()

void Vole_Base::Setm_Mature ( )
inline

◆ SetWeight()

void Vole_Base::SetWeight ( double  W)
inline

Set our weight

298 {m_Weight=W;}

References m_Weight.

Referenced by Vole_Population_Manager::CreateObjects_Init().

◆ st_Dying()

void Vole_Base::st_Dying ( void  )

All voles end here on death.

Called when a vole dies. Just removes itself from the map and sets a flag to destroy the object in the endStep

349 {
350  FreeLocation();
351  m_CurrentStateNo=-1;
352 }

References FreeLocation(), and TALMaSSObject::m_CurrentStateNo.

Referenced by Vole_JuvenileMale::EndStep(), Vole_Male::EndStep(), and Vole_JuvenileFemale::EndStep().

◆ Step()

virtual void Vole_Base::Step ( void  )
inlinevirtual

Step behaviour - must be implemented in descendent classes.

Reimplemented from TAnimal.

Reimplemented in Vole_Female, Vole_JuvenileFemale, Vole_Male, and Vole_JuvenileMale.

291 {};

◆ SupplyAge()

◆ SupplyAllele()

int Vole_Base::SupplyAllele ( int  locus,
int  allele 
)
inline

Genetic functionality

386 { return m_MyGenes.GetAllele(locus,allele); }
uint32 GetAllele(int pos, int Chromosome)
Definition: GeneticMaterial.cpp:233

References GeneticMaterial::GetAllele(), and m_MyGenes.

Referenced by Vole_Population_Manager::DoFirst(), and Vole_Population_Manager::GeneticsResultsOutput().

◆ SupplyBirthYear()

int Vole_Base::SupplyBirthYear ( )
inline

Tell our birth year

344 {return m_BirthYear;}; // ***TD***

References m_BirthYear.

Referenced by Vole_Population_Manager::GeneticsOutputFile().

◆ SupplyBornLastYear()

bool Vole_Base::SupplyBornLastYear ( )
inline

Were we born this year?

334 { return m_BornLastYear; }

References m_BornLastYear.

Referenced by Vole_Population_Manager::TheSexRatiosProbe().

◆ SupplyDeathCause()

int Vole_Base::SupplyDeathCause ( )
inline

Tell the cause of death

368 {return m_Death;}; // ***TD***
int m_Death
Definition: vole_all.h:170

References m_Death.

◆ SupplyElemBorn()

int Vole_Base::SupplyElemBorn ( )
inline

Tell our elementype at birth location

354 {return m_ElemBorn;}; // ***TD***

References m_ElemBorn.

Referenced by Vole_Population_Manager::GeneticsOutputFile().

◆ SupplyElemType()

TTypesOfLandscapeElement Vole_Base::SupplyElemType ( )
inline

◆ SupplyFatherId()

int Vole_Base::SupplyFatherId ( )
inline

Tell father ID

338 {return m_FatherId;}; // ***TD***

References m_FatherId.

◆ SupplyGenes()

GeneticMaterial Vole_Base::SupplyGenes ( )
inline

Genetic functionality

402 {return m_MyGenes;}

References m_MyGenes.

Referenced by Vole_Female::st_Mating().

◆ SupplyHeteroZyg()

int Vole_Base::SupplyHeteroZyg ( )
inline

Genetic functionality

384 {return m_MyGenes.HeterozygosityCount();}
int HeterozygosityCount()
Definition: GeneticMaterial.cpp:328

References GeneticMaterial::HeterozygosityCount(), and m_MyGenes.

◆ SupplyHomoZyg()

int Vole_Base::SupplyHomoZyg ( )
inline

Genetic functionality

382 {return m_MyGenes.HomozygosityCount();}
int HomozygosityCount()
Definition: GeneticMaterial.cpp:317

References GeneticMaterial::HomozygosityCount(), and m_MyGenes.

◆ SupplyIDNo()

int Vole_Base::SupplyIDNo ( )
inline

◆ SupplyInTrap()

bool Vole_Base::SupplyInTrap ( )
inline

Are we in a trap?

376 { return m_intrappos.m_inAtrap; }

References InTrapPosition::m_inAtrap, and m_intrappos.

Referenced by Vole_Population_Manager::DoFirst().

◆ SupplyMature()

bool Vole_Base::SupplyMature ( )
inline

◆ SupplyMotherId()

int Vole_Base::SupplyMotherId ( )
inline

Tell mother ID

340 {return m_MotherId;}; // ***TD***

References m_MotherId.

◆ SupplyMyAllele()

uint32 Vole_Base::SupplyMyAllele ( int  i,
int  j 
)
inline

◆ SupplyPolyRefBorn()

int Vole_Base::SupplyPolyRefBorn ( )
inline

Tell our polygon ref at birth location

352 {return m_PolyRefBorn;}; // ***TD***

References m_PolyRefBorn.

Referenced by Vole_Population_Manager::GeneticsOutputFile().

◆ SupplySex()

◆ SupplyTerritorial()

◆ SupplyTerrRange()

int Vole_Base::SupplyTerrRange ( )
inline

Tell our territory range

360 {return m_TerrRange;}; // ***TD***

References m_TerrRange.

◆ SupplyTotNoYoung()

int Vole_Base::SupplyTotNoYoung ( )
inline

Tell our number of young produced

346 {return m_NoOfYoungTotal;}; // ***TD***

References m_NoOfYoungTotal.

◆ SupplyTrapPosition()

InTrapPosition Vole_Base::SupplyTrapPosition ( )
inline

Get the trap location

378 { return m_intrappos; }

References m_intrappos.

Referenced by Vole_Population_Manager::DoFirst().

◆ SupplyVegBorn()

int Vole_Base::SupplyVegBorn ( )
inline

Tell our vegetation type at birth location

358 {return m_VegBorn;}; // ***TD***

References m_VegBorn.

Referenced by Vole_Population_Manager::GeneticsOutputFile().

◆ SupplyWeight()

double Vole_Base::SupplyWeight ( )
inline

Tell our weight

362 {return m_Weight;};

References m_Weight.

◆ SupplyX()

unsigned Vole_Base::SupplyX ( )
inline

Tell our x coordinate

372 {return m_Location_x;};

References TAnimal::m_Location_x.

Referenced by Vole_Population_Manager::SendMessage().

◆ SupplyXBorn()

int Vole_Base::SupplyXBorn ( )
inline

Tell our x-coordinate at birth

348 {return m_XBorn;}; // ***TD***

References m_XBorn.

Referenced by Vole_Population_Manager::DoFirst(), and Vole_Population_Manager::GeneticsOutputFile().

◆ SupplyY()

unsigned Vole_Base::SupplyY ( )
inline

Tell our y coordinate

374 {return m_Location_y;};

References TAnimal::m_Location_y.

Referenced by Vole_Population_Manager::SendMessage().

◆ SupplyYBorn()

int Vole_Base::SupplyYBorn ( )
inline

Tell our x-coordinate at birth

350 {return m_YBorn;}; // ***TD***

References m_YBorn.

Referenced by Vole_Population_Manager::DoFirst(), and Vole_Population_Manager::GeneticsOutputFile().

◆ UnsetDirectFlag()

void Vole_Base::UnsetDirectFlag ( )
inline

Genetic functionality

void UnsetDirectFlag()
Definition: GeneticMaterial.cpp:182

References m_MyGenes, and GeneticMaterial::UnsetDirectFlag().

Referenced by Vole_Population_Manager::CreateObjects().

◆ UnsetGeneticFlag()

void Vole_Base::UnsetGeneticFlag ( )
inline

Genetic functionality

void UnsetGeneticFlag()
Definition: GeneticMaterial.cpp:178

References m_MyGenes, and GeneticMaterial::UnsetGeneticFlag().

Referenced by Vole_Population_Manager::CreateObjects().

◆ WhatState()

virtual int Vole_Base::WhatState ( )
inlinevirtual

Get our current vole state

Reimplemented from TAnimal.

332 {return CurrentVState;}

References CurrentVState.

Member Data Documentation

◆ CurrentVState

◆ IDNo

unsigned Vole_Base::IDNo
protected

Their individual ID number

Referenced by Init(), and SupplyIDNo().

◆ m_Age

◆ m_BirthYear

int Vole_Base::m_BirthYear
protected

◆ m_BornLastYear

◆ m_BreedingSeason

bool Vole_Base::m_BreedingSeason = false
staticprotected

◆ m_Death

int Vole_Base::m_Death
protected

Death course

Referenced by SupplyDeathCause().

◆ m_DispVector

◆ m_ElemBorn

int Vole_Base::m_ElemBorn
protected

The element type at at birth location

Referenced by Set_ElemBorn(), and SupplyElemBorn().

◆ m_FatherId

unsigned Vole_Base::m_FatherId
protected

◆ m_FemaleTerritoryRangeSlope

double Vole_Base::m_FemaleTerritoryRangeSlope = 0
staticprotected

only used to create an increasing territory size with age

Referenced by Vole_JuvenileFemale::EndStep(), and Init().

◆ m_fertile

bool Vole_Base::m_fertile
protected

Flag indicating the fertility state (true means fertile)

Referenced by GetFertile(), Init(), and SetFertile().

◆ m_FHabQualThreshold1

double Vole_Base::m_FHabQualThreshold1
staticprotected

Habitat is v.bad below this

◆ m_FHabQualThreshold2

double Vole_Base::m_FHabQualThreshold2
staticprotected

Habitat is OK above this

◆ m_FHabQualThreshold3

double Vole_Base::m_FHabQualThreshold3
staticprotected

Habitat is v.good above this

◆ m_Have_Territory

◆ m_intrappos

InTrapPosition Vole_Base::m_intrappos
protected

◆ m_LifeSpan

int Vole_Base::m_LifeSpan
protected

Their lifespan remaining (unless killed by external events)

Referenced by Vole_JuvenileMale::BeginStep(), Vole_JuvenileFemale::BeginStep(), and Init().

◆ m_MaleTerritoryRangeSlope

double Vole_Base::m_MaleTerritoryRangeSlope = 0
staticprotected

only used to create an increasing territory size with age

Referenced by Vole_Male::DetermineTerritorySize(), and Init().

◆ m_Mature

◆ m_MaxFemaleTerritorySize

unsigned int Vole_Base::m_MaxFemaleTerritorySize = 0
staticprotected

Maximum territory size female

Referenced by Init().

◆ m_MaxMaleTerritorySize

unsigned int Vole_Base::m_MaxMaleTerritorySize = 0
staticprotected

Maximum territory size male

Referenced by Init(), and Vole_Female::st_Mating().

◆ m_MHabQualThreshold1

double Vole_Base::m_MHabQualThreshold1
staticprotected

Habitat is v.bad below this

◆ m_MHabQualThreshold2

double Vole_Base::m_MHabQualThreshold2
staticprotected

Habitat is OK above this

◆ m_MHabQualThreshold3

double Vole_Base::m_MHabQualThreshold3
staticprotected

Habitat is v.good above this

◆ m_MinFemaleTerritorySize

unsigned int Vole_Base::m_MinFemaleTerritorySize = 0
staticprotected

◆ m_MinFVoleHabQual

double Vole_Base::m_MinFVoleHabQual = 0
staticprotected

Minimum acceptable habitat quality - assumes that minimum hab qual for survival is 2 * min female terr size

Referenced by Init(), Vole_Male::st_Eval_n_Explore(), Vole_JuvenileFemale::st_Evaluate_n_Explore(), and Vole_Female::st_Evaluate_n_Explore().

◆ m_MinJMVoleHabQual

double Vole_Base::m_MinJMVoleHabQual = 0
staticprotected

Minimum acceptable habitat juvenile male quality - assumes that minimum hab qual for survival is 2 * min male terr size

Referenced by Init(), and Vole_JuvenileMale::st_Eval_n_Explore().

◆ m_MinMaleTerritorySize

unsigned int Vole_Base::m_MinMaleTerritorySize = 0
staticprotected

◆ m_MinMVoleHabQual

double Vole_Base::m_MinMVoleHabQual = 0
staticprotected

Minimum acceptable habitat quality - assumes that minimum hab qual for survival is 2 * min female terr size

Referenced by Vole_Male::CanFeed(), Vole_Male::Dispersal(), and Init().

◆ m_MinTerrRange

◆ m_MotherId

unsigned Vole_Base::m_MotherId
protected

◆ m_MyGenes

◆ m_NoOfYoungTotal

int Vole_Base::m_NoOfYoungTotal
protected

◆ m_OurPopulation

◆ m_PolyRefBorn

int Vole_Base::m_PolyRefBorn
protected

Their polygon ref at birth location

Referenced by Set_PolyRefBorn(), and SupplyPolyRefBorn().

◆ m_Reserves

int Vole_Base::m_Reserves
protected

Their reserves - in days that they can survive without food

Referenced by Init(), and Vole_Female::st_Lactating().

◆ m_Sex

◆ m_TerrRange

◆ m_VegBorn

int Vole_Base::m_VegBorn
protected

The vegetation type at birth location

Referenced by Set_VegBorn(), and SupplyVegBorn().

◆ m_Weight

◆ m_XBorn

int Vole_Base::m_XBorn
protected

Their x location at birth

Referenced by Set_XBorn(), and SupplyXBorn().

◆ m_YBorn

int Vole_Base::m_YBorn
protected

Their y location at birth

Referenced by Set_YBorn(), and SupplyYBorn().

◆ SimH

int Vole_Base::SimH
protected

◆ SimW


The documentation for this class was generated from the following files: